﻿using System;

namespace GdNet.WebFramework.Domain.System
{
    public partial class ModuleAction
    {
        public static ModuleActionFactory Factory
        {
            get { return new ModuleActionFactory(); }
        }

        public class ModuleActionFactory
        {
            /// <summary>
            /// Create a module action with auto generated code
            /// </summary>
            public ModuleAction Create(string name, string viewName, string className)
            {
                return Create(Guid.NewGuid().ToString(), name, viewName, className);
            }

            public ModuleAction Create(string code, string name, string viewName, string className)
            {
                return new ModuleAction()
                    {
                        Code = code,
                        Name = name,
                        ViewName = viewName,
                        ClassName = className
                    };
            }
        }
    }
}
